package com.chenjj.etl.datatrans.job;

import com.chenjj.etl.datatrans.converter.DataConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

/**
 * gz文件处理
 *
 * 1.解压文件
 * 2.逐行读取，将文件定长转定界到新文件
 */
public class GzFileProcess {

    private static Logger logger = LoggerFactory.getLogger(GzFileProcess.class);

    public static void main(String[] args) throws IOException {

        final String gzFilePath = args[0];
        final String flgFilePath = args[1];
        final String outputFilePath = args[2];
        final String characterset = args[3];

        long start = System.currentTimeMillis();
        DataConverter.convertGzFile(gzFilePath,flgFilePath,outputFilePath,characterset);
        long end = System.currentTimeMillis();
        logger.info("转换完成.耗时:{}ms",end-start);
    }
}
